package com.vortex.cloud.zhsw.xinyang.enums.gis;


import com.vortex.cloud.zhsw.xinyang.enums.IBaseEnum;

/**
 * gis类型
 *
 * @author huan
 */
public enum CoordinateSystemTypeEnum implements IBaseEnum {
    /**
     * 点
     */
    WGS84(1, "wgs84"),
    ;

    private final Integer key;

    private final String value;

    CoordinateSystemTypeEnum(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    @Override
    public int getKey() {
        return key;
    }

    @Override
    public boolean isShow() {
        return true;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static CoordinateSystemTypeEnum findByKey(Integer key) {
        for (CoordinateSystemTypeEnum typeEnum : CoordinateSystemTypeEnum.values()) {
            if (Integer.valueOf(typeEnum.getKey()).equals(key)) {
                return typeEnum;
            }
        }
        return null;
    }

    public static CoordinateSystemTypeEnum findByName(String name) {
        for (CoordinateSystemTypeEnum typeEnum : CoordinateSystemTypeEnum.values()) {
            if (typeEnum.name().equals(name.toUpperCase())) {
                return typeEnum;
            }
        }
        return null;
    }
}
